<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>增加用户</title> 
<link href="/Public/ui/css/main.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="/dadaocms/Public/ui/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="/dadaocms/Public/ui/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="/dadaocms/Public/ui/js/jquery.form.js"></script>
<style type="text/css">html,body {overflow-y:scroll}</style> 
<script type="text/javascript">
		$(function(){
			/*$('#form1').ajaxForm({
				beforeSubmit: checkForm ,
				success:	complete ,
				dataType:	'json'
			});*/
		     function checkForm(){
            	if( '' == $.trim($('#title').val())){
	                $('#result').html('标题不能为空').show();
	                return false;
            	}
            	}
           
           function complete(data){
            if (data.status==1){
                $('#result').html(data.info).show();
                // 更新列表
                data = data.data;
                //var html =  ' <ul id="d3"> <li class="w300" title="">'+data.title+' </li> <li><a href="javascript:editdoctor('+data.id+')">编辑</a> | <a href="javascript:edit('+data.id+')">删除</a></li> </ul> ' ;
                var html =  ' <ul id="d3"> <li class="w300" title="">'+data.title+' </li> </ul> ' ;
                $('#dep').append(html);
            }else{
                $('#result').html(data.info).show();
            }
        }
		});
		
		$(function(){
			$('#form2').ajaxForm({
				success: editok ,
				dataType: 'json'
			});
			function editok(data){
				if (data.status == 1){
					//alert("修改成功");
					window.location.reload();
				}else{
					alert(data.info);
				}
			}
		});
	  function checkTitle(){
           		$.post('/visit/Entity/checkTitle',{'title':$('#title').val()},function(data){
			            if (data.status ==1) {
			           $('#result').html(data.info).show();
			           //alert('数据重复');
           			 }
        			},'json'); 
    } 
      function editdoctor(id){
      		$('#adddiv').hide();
           		$.post('/visit/Entity/loadedit',{'id':id},function(data){
			            if (data.status ==1) {
			          		$('#editdiv').show();
			          		$('#id').val(data.data.id);
			          		$('#title2').val(data.data.title);
			          		//alert(data.data.title);
			           
           			 }else{
           			 	 $('#result').html(data.info).show();
           			 }
        			},'json'); 
    } 
      function deletedoctor(id){
      		if (confirm("你确定要删除吗？") == true ){
      		
      		$.post('/visit/Entity/delete',{'id':id},function(data){
			            if (data.status ==1) {
			           //$('#result').html(data.info).show();
			            //alert('成功删除数据');
			            window.location.reload(); 
           			 }else{
           			 	alert('删除失败');
           			 }
        			},'json'); 
        	}else{
        		return false;
        	}
      }
$(function(){
	var doctoradvice = $('#doctoradvice').val();
	$('#doctoradvice').click(function(){
		if($(this).val()==doctoradvice){
			$('#doctoradvice').val('');								  
		}
	});	  
});      
</script>
<script>
 function refreshParent() {
  window.opener.location.href = window.opener.location.href;
  window.close();  
 }              
</script>
</head> 

<body> 
<div style="height:30px;"></div>
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" style="background-color:#ECF4FD; border:1px #BED7E8 solid;" >
    <tr>
      <td height="25" colspan="2">&nbsp;</td>
    </tr>
  </table>
  <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" id="head2" style="display:none">
    <tr>
      <td colspan="2"> <table height="24" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="84" align="center" background="/Public/ywt/itemnote2.gif"><a href="#" onClick="ShowItem1()"><u>常规信息</u></a>&nbsp;</td>
            <td width="84" align="center" background="/Public/ywt/itemnote1.gif">高级参数</td>
          </tr>
        </table></td>
    </tr>
  </table>
<form name="form1" id="form1" action="__URL__/add" enctype="multipart/form-data" method="post">
<input type="hidden" name="action" value="add" />
  <table width="98%"  border="0" align="center" cellpadding="2" cellspacing="2" id="needset" style="background-color:#ECF4FD; border:1px #BED7E8 solid;">
    <tr>
      <td width="400%" height="24" class="bline"><table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="9%" style="">&nbsp;用户名：</td>
          <td width='16%'><input name="name" type="text" id="name" style="width:100px" value="" onClick="WdatePicker()">
          
          </td>
          <td width="9%" style="">密码：</td>
          <td width="16%"><input name="pwd" type="password" id="pwd" style="width:100px" value=""><input type="hidden" name="rand" value="{$rand}" /></td>
          <td width="9%">真实姓名：</td>
          <td width="16%"><input name="tname" type="text" id="tname" style="width:100px;" /></td>
          <td width="9%">&nbsp;<span style="">所在科室：</span></td>
          <td width="16%">232423</td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td width="400%" height="24" class="bline"><table width="98%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="9%"><span style="">&nbsp;是否启用：</span></td>
          <td width="16%" style="">启用：
            <input name="state" type="radio" id="radio3" value="1" checked="checked" />
&nbsp;停用：
<input name="state" type="radio" id="radio4" value="0" /></td>
          <td width="9%">权限设置：</td>
          <td width="16%">
          1111111
          </td>
          <td width="9%">&nbsp;</td>
          <td width="16%">&nbsp;</td>
          <td width="10%">&nbsp;</td>
          <td width='16%'>&nbsp;</td>
        </tr>
      </table></td>
    </tr>
    <tr>
      <td>    </td>
    </tr>
  </table>
  <!-- //高级参数 -->
  

<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F9FCEF" style="background-color:#ECF4FD; border:1px #BED7E8 solid;border-top:none;">
  <tr>
    <td height="35">
	<table width="100%" border="0" cellspacing="1" cellpadding="1">
        <tr>
          <td width="17%">&nbsp;</td>
          <td width="83%"><table width="214" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="115"><input name="imageField" type="image" src="/dadaocms/Public/ywt/button_ok.gif" width="60" height="22" class="np" border="0" style="cursor:pointer"></td>
                <td width="99">
                	<img src="/dadaocms/Public/ywt/button_reset.gif" width="60" height="22" border="0" onClick="location.reload();" style="cursor:pointer">
                </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</form>
</body> 
</html>